package router

import (
	"github.com/gin-gonic/gin"
	"go-learn/api"
)

func RedisRouter(Router *gin.RouterGroup) (R gin.IRoutes) {
	BaseRouter := Router.Group("redis_test")
	{
		// string
		BaseRouter.POST("Set", api.Set)
		BaseRouter.POST("Get", api.Get)
		BaseRouter.POST("MSet", api.MSet)
		BaseRouter.POST("MGet", api.MGet)
		BaseRouter.POST("Del", api.Del)
		// hash
		BaseRouter.POST("HSet", api.HSet)
		BaseRouter.POST("HGet", api.HGet)
		BaseRouter.POST("HMSet", api.HMSet)
		BaseRouter.POST("HMGet", api.HMGet)
		BaseRouter.POST("HDel", api.HDel)
		// 排行榜
		BaseRouter.POST("AddScore", api.AddScore)
		BaseRouter.POST("GetRankList", api.GetRankList)
		BaseRouter.POST("GetRankListByScore", api.GetRankListByScore)
		BaseRouter.POST("GetRankByName", api.GetRankByName)
	}
	return BaseRouter
}
